home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tk8.0 / tests / winClipboard.test < prev    next >
Encoding:
Text File  |  1997-08-15  |  1.5 KB  |  45 lines  |  [TEXT/ALFA]

  1. # This file is a Tcl script to test out Tk's Windows specific
  2. # clipboard code.  It is organized in the standard fashion for Tcl
  3. # tests.
  4. #
  5. # This file contains a collection of tests for one or more of the Tcl
  6. # built-in commands.  Sourcing this file into Tcl runs the tests and
  7. # generates output for errors.  No output means no errors were found.
  8. #
  9. # Copyright (c) 1997 by Sun Microsystems, Inc.
  10. #
  11. # See the file "license.terms" for information on usage and redistribution
  12. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  13. #
  14. # SCCS: @(#) winClipboard.test 1.3 97/07/01 18:10:37
  15.  
  16. if {$tcl_platform(platform)!="windows"} {
  17.     return
  18. }
  19.  
  20. if {[string compare test [info procs test]] == 1} {
  21.     source defs
  22. }
  23.  
  24. test winClipboard-1.1 {TkSelGetSelection} {
  25.     clipboard clear
  26.     catch {selection get -selection CLIPBOARD} msg
  27.     set msg
  28. } {CLIPBOARD selection doesn't exist or form "STRING" not defined}
  29. test winClipboard-1.2 {TkSelGetSelection} {
  30.     clipboard clear
  31.     clipboard append {}
  32.     list [selection get -selection CLIPBOARD] [testclipboard]
  33. } {{} {}}
  34. test winClipboard-1.3 {TkSelGetSelection & TkWinClipboardRender} {
  35.     clipboard clear
  36.     clipboard append abcd
  37.     list [selection get -selection CLIPBOARD] [testclipboard]
  38. } {abcd abcd}
  39. test winClipboard-1.4 {TkSelGetSelection & TkWinClipboardRender} {
  40.     clipboard clear
  41.     clipboard append "line 1\nline 2"
  42.     list [selection get -selection CLIPBOARD] [testclipboard]
  43. } [list "line 1\nline 2" "line 1\r\nline 2"]
  44.  
  45.